3.5.91 \(\int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx\) [491]

Optimal. Leaf size=49 \[ \frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d} \]

[Out]

2*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/d/(a-b)^(1/2)/(a+b)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3916, 2738, 214} \begin {gather*} \frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

(2*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]*d)

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3916

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a/b)*Si
n[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {\int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b}\\ &=\frac {2 \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b d}\\ &=\frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 48, normalized size = 0.98 \begin {gather*} -\frac {2 \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

(-2*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(Sqrt[a^2 - b^2]*d)

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 44, normalized size = 0.90

method result size
derivativedivides \(\frac {2 \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{d \sqrt {\left (a +b \right ) \left (a -b \right )}}\) \(44\)
default \(\frac {2 \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{d \sqrt {\left (a +b \right ) \left (a -b \right )}}\) \(44\)
risch \(\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d}\) \(139\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/d/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [A]
time = 2.81, size = 185, normalized size = 3.78 \begin {gather*} \left [\frac {\log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{2 \, \sqrt {a^{2} - b^{2}} d}, \frac {\sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{{\left (a^{2} - b^{2}\right )} d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

[1/2*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 + 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x +
 c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2))/(sqrt(a^2 - b^2)*d), sqrt(-a^2 + b^2)*arct
an(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c)))/((a^2 - b^2)*d)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c)),x)

[Out]

Integral(sec(c + d*x)/(a + b*sec(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 77, normalized size = 1.57 \begin {gather*} -\frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{\sqrt {-a^{2} + b^{2}} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

-2*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(2*a - 2*b) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))
/sqrt(-a^2 + b^2)))/(sqrt(-a^2 + b^2)*d)

________________________________________________________________________________________

Mupad [B]
time = 0.89, size = 40, normalized size = 0.82 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )}{d\,\sqrt {a+b}\,\sqrt {a-b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)*(a + b/cos(c + d*x))),x)

[Out]

(2*atanh((tan(c/2 + (d*x)/2)*(a - b)^(1/2))/(a + b)^(1/2)))/(d*(a + b)^(1/2)*(a - b)^(1/2))

________________________________________________________________________________________